<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'misaligned brake pads',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<img src="/img/CC_BY-SA_4.0/y.st./weblog/2018/11/18.jpg" alt="Broken cap" class="framed-centred-image" width="649" height="480"/>
<section id="Minetest">
	<h2>Minetest</h2>
	<p>
		I built most of a patching mod I need to get <code>minestats</code> running on Minetest 0.4.0.
		For the rest, I instead modified the built-in scripts, which will be lost upon upgrade, meaning I&apos;ll need to modify the new built-in scripts at that time.
		It works though.
	</p>
	<p>
		I&apos;ve already hit my first puzzle in implementing <code>minequest</code>.
		Even in modern Minetest, you can&apos;t add callbacks to player inventories.
		You can only do that with node inventories or detached inventories.
		So I&apos;ve been using detached inventories for that sort of thing, then presenting them to the player in their own inventory menus, as if they were player inventories.
		However, Minetest 0.4.0 doesn&apos;t have detached inventories.
		They hadn&apos;t been invented yet.
		I came up with a couple solutions I could code, but neither is pretty.
		Later in the day, I found that the old $a[API] is so limited that the first solution won&apos;t work at all.
		It involved buttons in the inventory menu, but such functionality wasn&apos;t available in 0.4.0!
		The only option is to use node inventories.
		This is gonna&apos; be messy.
	</p>
	<p>
		Before I can start work on anything of the sort though, I need to decide what I&apos;m going to do about figureing out which items even provide a possible bonus ability.
		I could try to provide an ability of all obtainable items, using ones not associated with an elemental stat to provide bonuses that are binary (either on or off, no levelled strength), or I could exclude those items altogether.
	</p>
</section>
<section id="bicycle">
	<h2>Bike repair</h2>
	<p>
		My front inner tube blew just a few days ago, and now my new (used) one&apos;s gone and blown again yesterday.
		Coincidence?
		I intended to try to prove otherwise.
		Maybe the tire has a sharp rock on the inside or something that is puncturing these inner tubes.
		Or maybe there&apos;s a sharp spot on the wheel itself.
		So this time, I didn&apos;t just remove the inner tube from the tire once the tire was separated from the wheel.
		I inflated the tube as much as possible, then squeezed it to use the sound of the escaping air to locate the hole.
		And quite a large hole it was!
		And it just so happens to line up with a hole in the side of the tire.
		The tire was worn on the side, seemingly due to the crooked brake pads, so I tweaked them into a better position that allows them to grab the wheel without touching the tire.
		This new tube shouldn&apos;t blow for a while this time.
	</p>
	<p>
		And to think that just yesterday, I was contemplating waiting until tomorrow to change the inner tube!
		I knew the tube that blew yesterday was old.
		I installed a used inner tube I took from some spare bike wheels I&apos;ve had a while.
		I think I&apos;ve had them at least a year, and I&apos;m not sure how old they were before that.
		They could be decades old, for all I know.
		I blamed the old rubber for the blown tube.
		The only tube I have left is from the other spare wheel, which would likely be just as old.
		I thought it might blow again.
		I thought it might be wise to save the tube for tomorrow so I could use the last of its lifespan to get to the bike shop for new spare tubes, as they&apos;re not open today.
		I finally convinced myself today though that the potential of not having a bike to get to the bike shop with tomorrow wasn&apos;t as bad as the guarantee that I wouldn&apos;t have the bike for my commute today.
		With the bum tire replaced, I don&apos;t think the tube will blow this time, so I&apos;ll have the bike for both trips.
	</p>
	<p>
		I do need spare tubes though.
		The funny thing is that I&apos;ve got two spare tubes I bought for such situations, but I bought them before the now-totalled bike was totalled.
		That bike&apos;s wheels are smaller than normal, so the tube I bought don&apos;t fit the current working bike.
	</p>
	<p>
		It&apos;s also bizarre that the totalled bike&apos;s tube went out on me though when I desperately needed a backup bike, even if it was one that didn&apos;t work well.
		Both bikes had tubes that went out on me for some reason.
		I&apos;m not going to look into the cause of the totalled bike&apos;s tube issue though.
		I&apos;m not replacing that tube, so there&apos;s no need to investigate what might cause it again.
		Besides, on that bike, it wasn&apos;t a reoccurring flat.
		Additionally, it wouldn&apos;t help me figure out why both bikes went out at once, which is the oddity at hand.
		Yesterday just sucked.
		That&apos;s all I have to say about that.
	</p>
</section>
<section id="drudgery">
	<h2>Drudgery</h2>
	<p>
		My discussion post for the day:
	</p>
	<blockquote>
		<p>
			I might be misunderstanding, but it sounds like you&apos;re saying that strings in any programming language reference a smaller data type called <code>char</code>.
			In some languages such as Java, yes, strings are made up of several items of a primitive <code>char</code> type, but that only applies to some languages.
			Many languages instead implement <code>string</code> as a primitive type, with no need for subunits.
			For example, one of the prerequisite courses we had to take before taking any Java-related courses at this university was taught in Python.
			In Python, strings are just <code>string</code>s.
			There are no <code>char</code>s.
			The <code>char</code> type isn&apos;t universal, and is instead specific to certain languages.
		</p>
		<p>
			I like your examples of Java&apos;s static typing though.
			It&apos;d be nice if more languages restricted the type of value in their variables; it&apos;d help with debugging.
		</p>
	</blockquote>
</section>
<section id="luck">
	<h2>Mildly-bad luck</h2>
	<p>
		My bad luck continues, but not nearly as bad today.
		I dropped my water bottle and the cap broke.
		Seriously, this is the first time this has ever happened.
		It&apos;s really weird.
		The worst part is I&apos;ll need to waste time tomorrow going out and buying a replacement after I buy those spare inner tubes.
	</p>
</section>
END
);
